<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<script type="text/javascript" src="${pageContext.request.contextPath }/statics/js/jquery-1.8.3.min.js"></script>
<head>
<base href="<%=basePath%>">

<title></title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>

<body>
	<table border="1px">
		<tr>
			<th>标题</th>
			<th>内容摘要</th>
			<th>作者</th>
			<th>发布时间</th>
			<th>操作</th>
		</tr>
		<!-- 循环帖子数据 -->
		<c:forEach var="n" items="${list}">
		<tr>
			<td>${n.title}</td>
			<td>${n.summary}</td>
			<td>${n.author}</td>
			<td>${n.createdate}</td>
			<td>
			<a href="#">回复</a>&nbsp;||&nbsp;
				<a href="javascript:deleteInvid('${pageContext.request.contextPath }',${n.id})" onclick="">删除</a>
			</td>
		</tr>
		</c:forEach>
	</table>
</body>
	<script type="text/javascript">
		function deleteInvid(path,id){
			$.getJSON(path+"/delete/"+id,function(data){
				if(data.result){
					alert("删除成功");
					window.location.reload();
				}else{
					alert("删除失败");
				}
			})
		}
	
	</script>
</html>
